package com.atguigu.dga.governance.assessor.spec;

import com.atguigu.dga.governance.assessor.Assessor;
import com.atguigu.dga.governance.bean.AssessParam;
import com.atguigu.dga.governance.bean.GovernanceAssessDetail;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;

/**
 * @author WEIYUNHUI
 * @date 2024/6/26 14:41
 * 
 * 是否有表备注指标
 */
@Component("TABLE_COMMENT")
public class TableCommentAssessor  extends Assessor {

    @Override
    public void checkProblem(GovernanceAssessDetail governanceAssessDetail, AssessParam assessParam) {
        String tableComment = assessParam.getTableMetaInfo().getTableComment();
        if (tableComment == null || tableComment.trim().isEmpty()){
            //给分
            governanceAssessDetail.setAssessScore(BigDecimal.ZERO);
            governanceAssessDetail.setAssessProblem("未设置表备注");
        }
    }
}
